<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
    <style lang="">
        div {
            width: 200px;
            margin: 200px auto;
            background: skyblue;
            text-align: center;
            height: 120px;
            line-height: 120px;
            border-radius: 4px;
        }
    </style>
</head>

<body>
    <div>
        <i class="hh">00</i> :
        <i class="mm">10</i> :
        <i class="ss">59</i>
    </div>
    <script>
        var id = setInterval(function() {
            var hh = parseInt($(".hh").text());
            var mm = parseInt($(".mm").text());
            var ss = parseInt($(".ss").text());

            ss--;
            if (ss < 0) {
                ss = 59;
                mm--;
            }

            if (ss < 10) {
                ss = "0" + ss;
            }

            if (mm < 0) {
                mm = 59;
                hh--;
            }
            if (mm < 10) {
                mm = "0" + mm;
            }

            if (hh < 10) {
                hh = "0" + hh;
            }

            $(".hh").text(hh);
            $(".mm").text(mm);
            $(".ss").text(ss);

            if (hh == 0 && mm == 0 && ss == 0) {
                console.log('结束了');
                clearInterval(id);
                $(".hh").text("00");
                $(".mm").text("00");
                $(".ss").text("00");
                $("div").css({
                    "background": "red"
                })

            }
        }, 1)
    </script>
</body>

</html>